//
//  FWEssenceService.m
//  BirdLoveSheep
//
//  Created by wwj on 16/3/21.
//  Copyright © 2016年 wwj. All rights reserved.
//

#import "FWEssenceService.h"
#import "FWHttpUtil.h"

@implementation FWEssenceService

+ (NSURLSessionDataTask *)getEssenceDataWith:(FWEssenceRequest *)request success:(void (^)(FWEssenceResponse *))success failure:(void (^)(NSError *))failure{
    return [FWHttpUtil getWithURL:KBaseURL params:request.mj_keyValues success:^(id responseObject) {
        if (success) {
            FWEssenceResponse *data = [FWEssenceResponse mj_objectWithKeyValues:responseObject];
            success(data);
        }
    } failure:^(NSError *error) {
        if (failure) {
            failure(error);
        }
    }];
}

+ (NSURLSessionDataTask *)getcommentDataWith:(FWComRquest *)request success:(void (^)(FWComResponse *))success failure:(void (^)(NSError *))failure{
    return [FWHttpUtil getWithURL:KBaseURL params:request.mj_keyValues success:^(id responseObject) {
        if (success) {
            FWComResponse *data = [FWComResponse mj_objectWithKeyValues:responseObject];
            success(data);
        }
    } failure:^(NSError *error) {
        if (failure) {
            failure(error);
        }
    }];
}
@end
